package cn.edu.gcu.PraticalTraining.serviceimpl;

import javax.annotation.Resource;
import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.gcu.PraticalTraining.domain.User;
import cn.edu.gcu.PraticalTraining.repository.UserRepository;
import cn.edu.gcu.PraticalTraining.service.UserService;

@Service("userService")
@Transactional
public class UserServiceImpl implements UserService {
	@Resource  
    private UserRepository userRepository;  
      
	public UserServiceImpl(UserRepository userRepository){
		this.userRepository = userRepository;
	}
	
    public void setUserRepository(UserRepository userRepository) {  
        this.userRepository = userRepository;  
    } 
	
	@Override
	public User findByUsername(String username) {
		return userRepository.findByUsername(username);
	}

	@Override
	public User updateUser(User user) {
		// TODO Auto-generated method stub
		return null;
	}

}
